1. Field of the Invention
The present invention relates to synchronizing video.
2. Description of the Related Art
When playing back audio/video streams, many playback devices try to recreate the audio and video clocks used for encoding. One means employed to recreate such clocks includes the use of a Phased Locked Loop (PLL) circuit.
The classic PLL includes a Phase Detector and a Voltage Controlled Oscillator (VCO). FIG. 1 provides an example of a PLL that includes Phase Detector 200 connected to VCO 202. Phase Detector 200 is a device that compares two input frequencies (f1 and f2) and generates an output that is a measure of their phase difference. If the frequency f1 differs from f2, the error signal from Phase Detector 200 causes the frequency of VCO 202 to deviate in the direction of f1. The PLL of FIG. 1 also includes dividers 204, 206 and 208. The input signal (In) is first sent to divider 204, where its frequency is divided by F. The output of divider 204 is provided to Phase Detector 200. The output of the VCO 202 is provided to divider 208, which divides the output frequency of VCO 202 by O. The output of divider 208 is the output (Out) of the PLL. The output of VCO 202 is also sent to divider 206, which divides the output frequency of VCO 202 by B. The output of divider 206 is the second input to Phase Detector 200.
The dividers 204, 206 and 208 divide the frequency of the signal they receive. FIG. 2 provides an example of an input signal 310 that enters a divider, which divides by 3, and a signal 312 that is the output of that divider. The signal 312 has a frequency that is one third of the frequency of signal 310. If, for example, signal 310 is the input to divider 204 and F=3, then signal 312 would be the output of divider 204.
When f1=f2 (with regard to the PLL of FIG. 1), the frequency of the output of divider 204 is equal to the frequency of the output of divider 206, and:
            In      F        =          VCO      B        and            Out      =              VCO        O              ,  where In is the frequency of the input signal, Out is the frequency of the output signal, and B, F, O are the divider parameters for the PLL. The equations can be solved for Out:
  Out  =            B      ⁡              (        IN        )                    F      ⁡              (        O        )            
Thus, Out is a function of In, determined by the PLL ratio B/(FO). A designer can, therefore, design a PLL to provide a certain output frequency in light of a particular input frequency by choosing the appropriate divider parameters B, F and O. Unfortunately, not all PLLs can provide a reasonable output waveform for every combination of divider parameters. Such limitations are due to device characteristics, and vary among different designs. As a general rule, the higher the integers in the numerator and the denominator of the PLL ratio, the poorer the quality of the resulting PLL output. For example, a PLL with a ratio of 6/1 should be easier and cheaper to make than a PLL that has a ratio of 1001/167.
Audio/video streams usually include an exact relationship between the number of audio samples encoded per unit of time and the number of images to be displayed. For example, a DVD transport stream may have a 48 kHz audio sample rate along with a (60/1.001) Hz video refresh rate. Thus, it is usually recommended that the audio and video clocks be generated from the same clock reference so that the ratio between the two clocks remains constant and drift between the audio and video clocks is avoided. However, because it may not be possible to implement every combination of divider parameters it is difficult to recreate both the exact audio clock and the exact video clock from the same clock source using some PLLs.
Because video data is conveniently grouped into frames, it has been easier to adjust video than audio. Therefore, typical designs include a source clock and PLL that exactly recreates the audio clock used for encoding. However, most reasonable cost PLLs in such systems cannot recreate the exact video clock that was used for encoding. Thus, over time, the playback application must add or drop frames (or audio samples) to maintain audio/video synchronization. This can be noticeable to the consumer.
Thus, there is a need to better synchronize video with the audio.